import request from '@/utils/request'

const api_name = '/serviceCms/bannerAdmin'

export default {

    // 获取banner分页列表
    getPageBannerList(page, limit){
        return request({
            url: `${api_name}/index/${page}/${limit}`,
            method: 'get',
        })
    },

    // 根据id获取Banner
    getBanner(bannerId){
        return request({
            url: `${api_name}/getBanner/${bannerId}`,
            method: 'get'
        })
    },
    
    // 添加Banner
    addBanner(banner){
        return request({
            url: `${api_name}/addBanner`,
            method: 'post',
            data: banner
        })
    },

    // 修改Banner
    updateBanner(banner){
        return request({
            url: `${api_name}/updateBanner`,
            method: 'post',
            data: banner
        })
    },

    // 删除Banner
    removeBanner(bannerId){
        return request({
            url: `${api_name}/removeBanner/${bannerId}`,
            method: 'delete'
        })
    }

}